<script setup>
import {ref,onMounted} from 'vue'

const isActive = ref(true)
const background = ref('#f0f')
// onMounted(()=>{
//   setInterval(()=>{
//     isActive.value = !isActive.value
//   },100)
// })
</script>

<template>
  <div>www1</div>
  <!--  class = "active" -->
  <div :class="{ active: isActive}" :style="{'background-color':background}">www1</div>
</template>

<style scoped>
.active{
  background-color: #f00;
}
</style>
